﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SmartEP.Presenter;

namespace SmartDesktop
{
    public partial class Step4View : PatientInformationBaseView, IStep4View
    {
        public Step4View(PatientCarePresenter presenter)
            : base(presenter)
        {
            InitializeComponent();
            this.Name = "Registration Step 4";
            MainForm.BarCaption.Text = this.Name;

            this.step = 4;
            this.GroupStep = GroupStepType.PatientInformation;
        }

        #region properties
        public String FirstName
        {
            get { return txtFirstName.Text; }
            set { txtFirstName.Text = value; }
        }

        public String LastName
        {
            get { return txtLastName.Text; }
            set { txtLastName.Text = value; }
        }

        public String MiddleInitial
        {
            get { return txtMiddle.Text; }
            set { txtMiddle.Text = value; }
        }

        public String MemberIdOrLast4SSN
        {
            get { return txtMemberID.Text; }
            set { txtMemberID.Text = value; }
        }

        public DateTime DateOfBirth
        {
            get { return dtpDOB.Value; }
            set { dtpDOB.Value = value; }
        }

        public String StreetAddress
        {
            get { return txtStreet.Text; }
            set { txtStreet.Text = value; }
        }

        public String City
        {
            get { return txtCity.Text; }
            set { txtCity.Text = value; }
        }

        public String State
        {
            get { return cboState.Text; }
            set { cboState.Text = value; }
        }

        public String Zip
        {
            get { return txtZip.Text; }
            set { txtZip.Text = value; }
        }

        private int _relationshipToPatient;
        public int RelationshipToPatient
        {
            get { return _relationshipToPatient; }
            set
            {
                if (rdSelf.Checked)
                {
                    _relationshipToPatient = 1;
                }
                else if (rdSpouse.Checked)
                {
                    _relationshipToPatient = 2;
                }
                else if (rdParent.Checked)
                {
                    _relationshipToPatient = 3;
                }
                else if (rdDomestic.Checked)
                {
                    _relationshipToPatient = 4;
                }
                else if (rdOther.Checked)
                {
                    _relationshipToPatient = 5;
                }
            }
        }

        private int _visionInsurance;
        public int VisionInsurance
        {
            get { return _visionInsurance; }
            set
            {
                if (rdNone.Checked)
                {
                    _visionInsurance = 0;
                }
                else if (rdAVP.Checked)
                {
                    _visionInsurance = 1;
                }
                else if (rdVSP.Checked)
                {
                    _visionInsurance = 2;
                }
                else if (rdBS.Checked)
                {
                    _visionInsurance = 3;
                }
                else if (rdMedicare.Checked)
                {
                    _visionInsurance = 4;
                }
                else if (rdEyeMed.Checked)
                {
                    _visionInsurance = 5;
                }
                else if (rdMesc.Checked)
                {
                    _visionInsurance = 6;
                }
                else if (rdMedical.Checked)
                {
                    _visionInsurance = 7;
                }
                else if (rdOther2.Checked)
                {
                    _visionInsurance = 8;
                }
            }
        }
        #endregion

        private void btnContinue_Click(object sender, EventArgs e)
        {
            this.presenter.DisplayNextStep(this.step);
        }

        private void btnBack_Click(object sender, EventArgs e)
        {
            this.presenter.BackToPreviousStep(this.step);
        }

    }
}
